package cn.neusoft.neusoft_fz.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class InvoiceProducer {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    public void sendToQueue(String message) {
        log.info("Sending message to the queue. Message: {}", message);
        rabbitTemplate.convertAndSend("myQueue", message);
        log.info("Message sent successfully.");
    }
}
